<?php
require_once 'Response.php';
require_once 'DB.php';
header('Content-Type:text/json;charset=utf-8');
# 设置允许跨域
header("Access-Control-Allow-Origin: *");

$pdo = DB::getInstance()->connect();

//3、查询
$sql='SELECT * FROM `menu`';
//$sql='SELECT news.*,name FROM `news` LEFT JOIN news_type ON news.type_id=news_type.id '.$str_search.'ORDER BY id DESC LIMIT '.($curr-1)*$per.','.$per;
//$stmt = $pdo->query($sql); //返回一个PDOStatement对象
//$data = $stmt->fetchAll();//获得所有
$stmt=$pdo->query($sql);
$menulist=$stmt->fetchall();
Response::json('200','登录成功',$menulist);
//var_dump($menulist);

?>

